﻿@model RiderShop.Mobile.Modle.Purchase.ShippingCartModel
<form id="toPreCheck" method="post" action="~/Purchase/PreCheckProduct">
    <div>
        @if (Model.CartInfo.CommonProductListNoCOM.Count == 0)
        {
            <div class="mt30 mb30">
       	        <div class="icon-cart">
        	        <span></span>
						 <p class="f18 mb25">您的购物车暂时没有商品,请先选择您喜欢的商品!</p>
			 </div>
            </div>
        }
        @foreach (var itemInfo in Model.CartInfo.CommonProductListNoCOM)
        {
            <div class="groupbox">
                <div class="OtherTitle">
                    <div class="TitleLeft"> <span class="TitleLeftSpan">商品:@itemInfo.ProductId</span></div>
                    <div class="TitleRight"> 
                        <span name="EditQtyAfter" class="ItemQtySpan">
                            <div class="ItemQty">
                                <div class="ReduceTable">
                                    <div class="Reduce gradientBlue2">
                                        <a href="#" class="btnReduce" pid="@itemInfo.ProductId"> <div class="Reduceicon"></div></a>
                                    </div>
                                </div>
                                <div id="Qty_@itemInfo.ProductId" lqty="@itemInfo.LimitQuantity" class="QtyTable">@itemInfo.Quantity</div>
                                <div class="AddTable">
                                    <div class="add gradientBlue2">
                                        <a href="#" class="btnAdd" pid="@itemInfo.ProductId"> <div class="addicon"></div></a>
                                    </div>
                                </div>
                            </div>
                        </span>
                    </div>
                </div>
                <div class="ItemTable">
                    <div id="OtherProductLeft" class="ItemTableLeft fl">
                        <div class="Remove gradientBlue2">
                            <a href="~/Purchase/ShoppingCart?id=@itemInfo.ProductId" class="btnRemove" pid="@itemInfo.ProductId"> <div class="removeicon"></div></a>
                        </div>
                    </div>
                    <div id="OtherProductRight" class="ItemTableRight">
                        <div class="OtherProductItem">
                            <div class="ItemLeft">
                                    @if (itemInfo.ProductId.Trim() == "COM")
                                    {
                                        <img src="http://dev.rongji365.com/Storage/CommResource/COM/COM_100.jpg" alt="" />
                                    }
                                    else
                                    {
                                        <img src="@itemInfo.ImageName" alt="" />
                                    }
                            </div>
                            <div class="ItemRight"> <span class="ItemRightWrod">@itemInfo.Title</span> </div>
                        </div>
                        <div class=""> </div>
                        <div class="ProductPrice"> <span id="prd_price_@itemInfo.ProductId" price="@itemInfo.UnitPrice" class="Price">@itemInfo.Quantity x @itemInfo.UnitPrice = ￥@itemInfo.SubTotal</span> </div>
                    </div>
                </div>
            </div>
        }
    </div>
</form>
<a href="~/Home" data-role="button" >继续购物</a>
 @if (Model.CartInfo.CommonProductListNoCOM.Count > 0)
 {
     <form id="toCheckout" method="post" action="~/Purchase/CheckOut">
         <a href="#" id="btnCheckout" data-role="button" data-theme="f">立即结算</a>
     </form>
 }
 <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            $(".btnReduce").click(function () {
                var pid = $(this).attr("pid");
                DeclineToCart(this, pid);
            });
            $(".btnAdd").click(function () {
                var pid = $(this).attr("pid");
                IncreaseToCart(this, pid);

                return false;
            });
            $(".btnRemove").click(function () {
                var pid = $(this).attr("pid");
                KevinShop.Common.ShoppingCart.DeletePrdFromCart(pid);
            });
            $("#btnCheckout").click(function () {
                checkout();
            });
        });

</script>
@section footer
{
    <script type="text/javascript" src="~/Utility/pages/pg_purchase.js"></script>
}